﻿Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports DoAnQuanLyBanHang1065043_1065007.DoAnQuanLyBanHang.General
Imports System.Data
Imports System.Data.SqlClient

Namespace DoAnQuanLyBanHang.DTO
    Public Class LoaiGiaoDichData
        Private m_LoaiGiaoDichData As New DataService()

        Public Function LayLoaiGiaoDich() As DataTable
            Dim cmd As New SqlCommand("SELECT * FROM Loai_Giao_Dich")
            m_LoaiGiaoDichData.Load(cmd)
            Return m_LoaiGiaoDichData
        End Function

        Public Function ThemDongMoi() As DataRow
            Return m_LoaiGiaoDichData.NewRow()
        End Function

        Public Sub ThemLoaiGiaoDich(m_Row As DataRow)
            m_LoaiGiaoDichData.Rows.Add(m_Row)
        End Sub

        Public Function LuuLoaiGiaoDich() As Boolean
            Return m_LoaiGiaoDichData.ExecuteNoneQuery() > 0
        End Function

    End Class
End Namespace
